package com.ft.oa.domain.development;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ft.oa.utils.SecurityUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * 研发产品表
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class DevProduct {

  /**
   * 主键id
   */
  @TableId(type = IdType.AUTO)
  private Integer id;
  /**
   *  产品名称
   */
  private String name;
  /**
   * 产品规划
   */
  private String info;
  /**
   * 创建时间
   */
  private LocalDateTime createTime;
  /**
   * 更新时间
   */
  private LocalDateTime updateTime;
  /**
   * 删除时间
   */
  private LocalDateTime delTime;
  /**
   * 删除
   */
  private Boolean del;
  /**
   * 产品版本
   */
  @TableField(exist = false)
  private String versions;
  /**
   * 编排架构版本
   */
  @TableField(exist = false)
  private String framework;

  /**
   * 编排架构数量
   */
  @TableField(exist = false)
  private Integer frameworkCount;
  /**
   * 编排产品版本
   */
  @TableField(exist = false)
  private String iterationVersions;
  /**
   * 编排产品数量
   */
  @TableField(exist = false)
  private Integer iterationVersionsCount;
  /**
   * 组建功能版本
   */
  @TableField(exist = false)
  private String taskVersions;
  /**
   * 组建功能总数量
   */
  @TableField(exist = false)
  private Integer taskVersionsCount;

  /**
   * 页数
   */
  @TableField(exist = false)
  private int page;
  /**
   * 每页条数
   */
  @TableField(exist = false)
  private int size;

  /**
   * 创建人id
   */
  private Long creator = SecurityUtils.getCurrentUser().getId();

  /**
   * 修改人id
   */
  private Long editor = SecurityUtils.getCurrentUser().getId();

  public DevProduct(DevProduct e, ProductVersion ee) {

    this.id = e.getId();
    this.name = e.getName();
    this.info = e.getInfo();
    this.createTime = e.getCreateTime();
    this.updateTime = e.getUpdateTime();
    this.versions = ee.getProductVersions();
    this.framework = e.getFramework();
    this.frameworkCount = e.getFrameworkCount();
    this.iterationVersions = e.getIterationVersions();
    this.iterationVersionsCount = e.getIterationVersionsCount();
    this.taskVersions = e.getTaskVersions();
    this.taskVersionsCount = e.getTaskVersionsCount();

  }
}
